--[[/**
-- * 
 * 受到近战伤害，都会闪现远离该敌人
 * 
-- *
-- */]]

---@class BuffEffect143100 : BaseBuffEffect
BuffEffect143100 = ClientFight.CreateClass("BuffEffect143100", ClientFight.BaseBuffEffect)
local t = BuffEffect143100

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local fighter = buff.source;
local parameters = {...};
    local trigger = parameters[1];

    if (fighter:isDie()) then
    return IBuffEffect.FAIL;
    end

    -- 非远程职业
    if (trigger.isRangedCLass() or trigger.heroBean.f_HeroType == HeroConst.Hero_Type_NONE) then
    return IBuffEffect.FAIL;
    end
    -- 可以行动
    if (FighterStateEnum.is(fighter, FighterStateEnum.CAN_NOT_MOVE)
    or FighterStateEnum.is(fighter, FighterStateEnum.CAN_NOT_USE_SKILL)) then
    return IBuffEffect.FAIL;
    end

    -- 现在在施放技能(非普通攻击)动作中
    if (fighter.usingSkill ~= nil and fighter.usingSkill.skill.skillBean
    .f_SkillType ~= SkillTypeEnum.NORMAL_ATTACK) then
    return IBuffEffect.FAIL;
    end

    local skillId = buff.buffBean.f_BuffEffectValue[1];
    -- 上一次触发时间是否在间隔以内
    if (SkillManager.isCooldowning(fighter, skillId)) then
    return IBuffEffect.FAIL;
    end

    SkillRoleMgr.savePathFile( "[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff"
    .. buff.modelId .. " 触发远离技能" .. skillId);

    -- 触发技能
    ClientFight.BaseBuffEffect.triggerSkill(self,fight, fighter, trigger, skillId);

    return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
end

t.New()